//
//  receiveShipOverViewController.m
//  WHB_driver
//
//  Created by 徐国庆 on 15/12/26.
//  Copyright (c) 2015年 turing. All rights reserved.
//

#import "receiveShipOverViewController.h"

@interface receiveShipOverViewController ()

@property(nonatomic, strong)OrderModel *order;

@end

@implementation receiveShipOverViewController

- (instancetype)initWithOrder:(OrderModel *)order{
    self = [super init];
    if (self) {
        self.order = order;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navtitle.text = @"取货完成";
    [self initWithView];
}

#pragma mark 完成按钮点击方法
- (void)completeButtonAction:(UIButton *)button{
    NSLog(@"完成");
}

/**
 *  初始化视图
 */
- (void)initWithView{
    
    // 二维码
    UIImageView *QrCodeImageView = [[UIImageView alloc] initWithFrame:CGRectMake((kUIScreenWidth -   200) / 2, 100, 200, 200)];
    [QrCodeImageView sd_setImageWithURL:[NSURL URLWithString:@"http://simg.sinajs.cn/blog7newtpl/image/30/30_1/images/sinablogb.jpg"]];
    [self.view addSubview:QrCodeImageView];
    
    // 说明
    UILabel *contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(QrCodeImageView.frame.origin.x, CGRectGetMaxY(QrCodeImageView.frame) + 20, 200, 50)];
    contentLabel.numberOfLines = 2;
    contentLabel.text = @"此二维码仅供取货方人员扫描,以确认取货完成";
    contentLabel.textAlignment = 1;
    [self.view addSubview:contentLabel];
    contentLabel.textColor = [UIColor HexStrWithColor:@"999999"];
    contentLabel.font = [UIFont systemFontOfSize:14];
    
    // 完成
    UIButton *completeButton = [UIButton buttonWithType:UIButtonTypeCustom];
    completeButton.frame = CGRectMake((kUIScreenWidth - 250) / 2, CGRectGetMaxY(contentLabel.frame) + 20, 250, 45);
    completeButton.layer.masksToBounds = YES;
    completeButton.layer.cornerRadius = 22.5;
    completeButton.backgroundColor = [UIColor HexStrWithColor:@"f8cc00"];
    [completeButton setTitle:@"完成" forState:UIControlStateNormal];
    [completeButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [completeButton addTarget:self action:@selector(completeButtonAction:) forControlEvents:UIControlEventTouchDown];
    [self.view addSubview:completeButton];
    
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
